/**
 * 
 */
package com.walle.springinpractice.ch01;

import java.util.List;

import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.walle.springinpractice.ch01.model.Account;
import com.walle.springinpractice.ch01.service.AccountService;

/**
 * @author <a href="mailto:wallellen@hotmail.com">Walle</a>
 * 
 *         2014年1月23日
 */
public class ConsoleApp {

	@Test
	public void testCsvAccountService() throws Exception {
		AccountService service = context.getBean("accountService",
				AccountService.class);

		List<Account> accounts = service.findDeliquentAll();

		for (Account account : accounts) {
			System.err.println("NO.:" + account.getAccountNo());
		}
	}

	@Before
	public void setUp() {
		context = new ClassPathXmlApplicationContext(
				"com/walle/springinpractice/ch01/ApplicationContext.xml");
	}

	private ApplicationContext context;
}
